<?php
//模型
class SportTrainDataModel extends MY_Model {
	function __construct(){
		parent::__construct();
		$this->table = 'sport_train_data';
	}
	
	function get_list($cid){
		$where =  " 1";
		
		$sql = "select * from ".$this->db->dbprefix.$this->table." where {$where} limit 1000";
		$query = $this->db->query($sql);
		$res  = $query->result_array();
		
		return $res;
	}
	

	function ids_get_data($ids_arr){
		
		$ids  = implode(',',$ids_arr);
		if(empty($ids)){
			return false;
		}
		
		$where = " id in({$ids}) ";
		
		$sql = "select * from ".$this->db->dbprefix.$this->table." where {$where} order by field(id,{$ids})";
		$query = $this->db->query($sql);
		$res  = $query->result_array();
		
		return $res;
	}
}

